package com.jjh.service.impl;

import com.jjh.winterframework.annatation.Component;
import com.jjh.dao.impl.OrderDaoImpl;
import com.jjh.pojo.Order;
import com.jjh.service.OrderService;
import com.jjh.winterframework.annatation.Autowired;

import java.util.List;

@Component
public class OrderServiceImpl implements OrderService {

    @Autowired
    private OrderDaoImpl orderdaoImpl;


    /**
     * 向订单表中插入一条数据
     * @param order 订单实体对象
     * @return 是否插入成功
     */
    @Override
    public boolean insertOne(Order order) {
        return orderdaoImpl.insertOne(order);
    }

    @Override
    public List<Order> getOrderByUserId(int id) {
        return orderdaoImpl.getOrdersByUsrId(id);
    }


}
